-- Path of Building
--
-- Dexterity support gems
-- Skill data (c) Grinding Gear Games
--
local skills, mod, flag, skill = ...

#skill SupportAddedColdDamage
#mods

#skill SupportAddedColdDamagePlus
#mods

#skill SupportAdditionalAccuracy
#mods

#skill SupportArrowNova
	statMap = {
		["support_rain_projectile_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Projectile),
		},
	},
#mods

#skill SupportArrowNovaPlus
	statMap = {
		["support_rain_projectile_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Projectile),
		},
	},
#mods

#skill SupportBarrage Barrage Support
	statMap = {
		["support_barrage_damage_+%_final"] = {
			mod("Damage", "MORE", nil, 0, 0, { type = "Condition", varList = { "UsingBow", "UsingWand" }}),
		},
		["projectiles_barrage"] = {
			flag("SequentialProjectiles", { type = "Condition", varList = { "UsingBow", "UsingWand" }}),
		},
		["number_of_additional_projectiles"] = {
			mod("ProjectileCount", "BASE", nil, 0, 0, { type = "Condition", varList = { "UsingBow", "UsingWand" }}),
		},
		["skill_can_only_use_non_melee_weapons"] = {
		},
	},
#mods

#skill SupportBlind
#mods

#skill SupportBlockReduction
	statMap = {
		["global_reduce_enemy_block_%"] = {
			mod("reduceEnemyBlock", "BASE", nil, 0, 0)
		},
		["support_reduce_enemy_block_and_spell_block_%"] = {
			mod("reduceEnemyBlock", "BASE", nil, 0, 0)
		},
	},
#mods

#skill SupportCastOnCrit
	statMap = {
		["support_cast_on_crit_spell_damage_+%_final"] = {
		},
	},
#mods

#skill SupportCastOnCritTriggered
	statMap = {
		["support_cast_on_crit_spell_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Spell),
		},
	},
#mods

#skill SupportCastOnCritPlus
	statMap = {
		["support_cast_on_crit_spell_damage_+%_final"] = {
		},
	},
#mods

#skill SupportCastOnCritTriggeredPlus
	statMap = {
		["support_cast_on_crit_spell_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Spell),
		},
	},
#mods

#skill SupportCastOnDeath
	statMap = {
		["area_of_effect_+%_while_dead"] = {
			mod("AreaOfEffect", "INC", nil),
		},
		["cast_on_death_damage_+%_final_while_dead"] = {
			mod("Damage", "MORE", nil),
		},
		["no_cost"] = {
		},
	},
#baseMod skill("triggeredOnDeath", true)
#mods

#skill SupportChain
	statMap = {
		["support_chain_hit_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Hit),
		},
	},
#mods

#skill SupportChainPlus
	statMap = {
		["support_chain_hit_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Hit),
		},
	},
#mods

#skill SupportChanceToFlee
#mods

#skill SupportGemFrenzyPowerOnTrapTrigger
	statMap = {
		["trap_trigger_radius_"] = {
			mod("TrapTriggerAreaOfEffect", "INC", nil, 0, 0, { type = "Multiplier", var = "PowerCharge" } )
		},
	},
#mods

#skill SupportSlashingWeapon
	statMap = {
		["support_slashing_damage_+%_final_from_distance"] = {
			mod("Damage", "MORE", nil, bit.bor(ModFlag.Attack, ModFlag.Melee), 0, { type = "MeleeProximity", ramp = {1,0} }),
		},
		["support_slashing_buff_attack_speed_+%_final_to_grant"] = {
			mod("Speed", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Combat Rush", effectCond = "CombatRushActive" }, { type = "Condition", var = "SupportedByCloseCombat", neg = true }, { type = "SkillType", skillType = SkillType.Travel }),
		},
		["close_combat_damage_to_close_range_+%"] = {
			mod("Damage", "INC", nil, bit.bor(ModFlag.Attack, ModFlag.Melee), 0, { type = "Condition", var = "AtCloseRange" }),
		},
		["supported_skill_can_only_use_axe_and_sword"] = {
		},
	},
#baseMod flag("Condition:SupportedByCloseCombat")
#mods

#skill SupportClusterTrap
	statMap = {
		["support_clustertrap_damage_+%_final"] = {
			mod("Damage", "MORE", nil),
		},
	},
#mods

#skill SupportColdPenetration
#mods

#skill SupportColdPenetrationPlus
#mods

#skill SupportCullingStrike
#mods

#skill SupportDeadlyAilments
	statMap = {
		["support_better_ailments_hit_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Hit),
		},
		["support_better_ailments_ailment_damage_+%_final"] = {
			mod("Damage", "MORE", nil, 0, bit.bor(KeywordFlag.Bleed, KeywordFlag.Poison, KeywordFlag.Ignite)),
		},
	},
#mods

#skill SupportDeadlyAilmentsPlus
	statMap = {
		["support_better_ailments_hit_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Hit),
		},
		["support_better_ailments_ailment_damage_+%_final"] = {
			mod("Damage", "MORE", nil, 0, bit.bor(KeywordFlag.Bleed, KeywordFlag.Poison, KeywordFlag.Ignite)),
		},
	},
#mods

#skill SupportAdditionalQuality
	statMap = {
		["supported_active_skill_gem_quality_%"] = {
			mod("SupportedGemProperty", "LIST", { keyword = "grants_active_skill", key = "quality", value = nil }),
		},
	},
#mods

#skill SupportAdditionalQualityPlus
	statMap = {
		["supported_active_skill_gem_quality_%"] = {
			mod("SupportedGemProperty", "LIST", { keyword = "grants_active_skill", key = "quality", value = nil }),
		},
	},
#mods

#skill SupportFasterAttack
#mods

#skill SupportFasterProjectiles
#mods

#skill SupportFocusedBallista
	statMap = {
		["support_focused_ballista_totem_attack_speed_+%_final"] = {
			mod("Speed", "MORE", nil, ModFlag.Attack),
		},
		["support_focused_ballista_totem_damage_+%_final"] = {
			mod("Damage", "MORE", nil),
		},
	},
#mods

#skill SupportFork
	statMap = {
		["support_fork_projectile_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Projectile),
		},
	},
#mods

#skill SupportForkPlus
	statMap = {
		["support_fork_projectile_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Projectile),
		},
	},
#mods

#skill SupportGreaterMultipleProjectiles
	statMap = {
		["support_multiple_projectile_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Projectile),
		},
	},
#mods

#skill SupportGreaterMultipleProjectilesPlus
	statMap = {
		["support_multiple_projectile_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Projectile),
		},
	},
#mods

#skill SupportGreaterVolley
	statMap = {
		["support_greater_volley_projectile_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Projectile),
		},
	},
#mods

#skill SupportDamageAgainstChilled
	statMap = {
		["support_hypothermia_damage_+%_vs_chilled_enemies_final"] = {
			mod("Damage", "MORE", nil, 0, bit.bor(KeywordFlag.Hit, KeywordFlag.Ailment), { type = "ActorCondition", actor = "enemy", var = "Chilled" }),
		},
		["support_hypothermia_cold_damage_over_time_+%_final"] = {
			mod("ColdDamage", "MORE", nil, 0, KeywordFlag.ColdDot),
		},
	},
#mods

#skill SupportImpale
	statMap = {
		["impale_support_physical_damage_+%_final"] = {
			mod("PhysicalDamage", "MORE", nil),
		},
		["impale_phys_reduction_%_penalty"] = {
			mod("EnemyImpalePhysicalDamageReduction", "BASE", nil),
			mult = -1,
		}
	},
#mods

#skill SupportFrenzyChargeOnSlayingFrozenEnemy
#mods

#skill SupportLesserMultipleProjectiles
	statMap = {
		["support_lesser_multiple_projectile_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Projectile),
		},
	},
#mods

#skill SupportLocusMine
	addFlags = {
		mine = true,
	},
	statMap = {
		["support_locus_mine_damage_+%_final"] = {
			mod("Damage", "MORE", nil),
		},
		["number_of_projectiles_+%_final_from_locus_mine_support"] = {
			mod("ProjectileCount", "MORE", nil),
		},
	},
#mods

#skill SupportChanceToPoison
#mods

#skill SupportManaLeech
#mods

#skill SupportMarkOnHit
#mods

#skill SupportGemMirageArcher
	statMap = {
		["support_mirage_archer_base_duration"] = {
			mod("MirageArcherDuration", "BASE", nil),
			div = 1000,
		},
		["support_mirage_archer_damage_+%_final"] = {
			mod("MirageArcherLessDamage", "BASE", nil),
		},
		["support_mirage_archer_attack_speed_+%_final"] = {
			mod("MirageArcherLessAttackSpeed", "BASE", nil),
		},
		["summon_mirage_archer_on_hit"] = {
			mod("MirageArcherMaxCount", "BASE", 1),
		},
	},
#mods

#skill SupportMultiTrap
	statMap = {	
		["support_multithrow_damage_+%_final"] = {
			mod("Damage", "MORE", nil),
		},
	},
#mods

#skill SupportPuncturingWeapon
	statMap = {
		["supported_skill_can_only_use_dagger_and_claw"] = {
		},
	},
#baseMod flag("SupportedByNightblade")
#baseMod flag("Condition:CanBeElusive", { type = "GlobalEffect", effectType = "Buff" })
#mods

#skill SupportPierce
	statMap = {
		["support_pierce_projectile_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Projectile),
		},
	},
#mods

#skill SupportPointBlank
	statMap = {
		["keystone_point_blank"] = {
			flag("PointBlank"),
		},
		["knockback_chance_%_at_close_range"] = {
			mod("EnemyKnockbackChance", "BASE", nil, ModFlag.Hit),
		},
	},
#mods

#skill SupportCriticalStrikeAffliction
#mods

#skill SupportSadism
	statMap = {
		["support_faster_ailments_ailment_duration_+%_final"] = {
			mod("EnemyAilmentDuration", "MORE", nil), 
		},
	},
#mods

#skill SupportAdditionalCooldown
#mods

#skill SupportSlowerProjectiles
	statMap = {
		["support_slower_projectiles_projectile_speed_+%_final"] = {
			mod("ProjectileSpeed", "MORE", nil),
		},
		["support_slower_projectiles_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Projectile),
		},
	},
#mods

#skill SupportRapidDecay
	statMap = {
		["support_rapid_decay_damage_over_time_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Dot),
		},
	},
#mods

#skill SupportReturningProjectiles
#mods

#skill SupportSwiftAfflictionPlus
	statMap = {
		["support_rapid_decay_damage_over_time_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Dot),
		},
	},
#mods

#skill SupportAdditionalTrapMine
#mods

#skill SupportTrap
	addFlags = {
		trap = true,
	},
	statMap = {
		["base_skill_show_average_damage_instead_of_dps"] = {
			skill("showAverage", true, { type = "SkillType", skillType = SkillType.Trappable }),
		},
	},
#mods

#skill SupportTrapCooldown
#mods

#skill SupportTrapAndMineDamage
	statMap = {
		["support_trap_and_mine_damage_+%_final"] = {
			mod("Damage", "MORE", nil, 0, bit.bor(KeywordFlag.Trap, KeywordFlag.Mine)),
		},
		["support_trap_and_mine_damage_mine_throwing_speed_+%_final"] = {
			mod("MineLayingSpeed", "MORE", nil),
		},
		["support_trap_and_mine_damage_trap_throwing_speed_+%_final"] = {
			mod("TrapThrowingSpeed", "MORE", nil),
		},
	},
#mods

#skill SupportPhysicalProjectileAttackDamage
	statMap = {
		["support_projectile_attack_speed_+%_final"] = {
			mod("Speed", "MORE", nil, bit.bor(ModFlag.Attack, ModFlag.Projectile)),
		},
		["support_projectile_attack_physical_damage_+%_final"] = {
			mod("PhysicalDamage", "MORE", nil, bit.bor(ModFlag.Attack, ModFlag.Projectile)),
		},
		["support_phys_chaos_projectile_physical_damage_over_time_+%_final"] = {
			mod("PhysicalDamage", "MORE", nil, 0, KeywordFlag.PhysicalDot),
		},
		["support_phys_chaos_projectile_chaos_damage_over_time_+%_final"] = {
			mod("ChaosDamage", "MORE", nil, 0, KeywordFlag.ChaosDot),
		},
	},
#mods

#skill SupportViciousProjectilesPlus
	statMap = {
		["support_projectile_attack_speed_+%_final"] = {
			mod("Speed", "MORE", nil, bit.bor(ModFlag.Attack, ModFlag.Projectile)),
		},
		["support_projectile_attack_physical_damage_+%_final"] = {
			mod("PhysicalDamage", "MORE", nil, bit.bor(ModFlag.Attack, ModFlag.Projectile)),
		},
		["support_phys_chaos_projectile_physical_damage_over_time_+%_final"] = {
			mod("PhysicalDamage", "MORE", nil, 0, KeywordFlag.PhysicalDot),
		},
		["support_phys_chaos_projectile_chaos_damage_over_time_+%_final"] = {
			mod("ChaosDamage", "MORE", nil, 0, KeywordFlag.ChaosDot),
		},
	},
#mods

#skill SupportDebilitate
	statMap = {
		["support_debilitate_poison_damage_+%_final"] = {
			mod("Damage", "MORE", nil, 0, KeywordFlag.Poison),
		},
		["support_debilitate_hit_damage_+%_final_per_poison_stack"] = {
			mod("Damage", "MORE", nil, ModFlag.Hit, 0, { type = "Multiplier", actor = "enemy", var = "PoisonStack", limitVar = "VileToxinsPoisonLimit" }),
		},
		["support_debilitate_hit_damage_max_poison_stacks"] = {
			mod("Multiplier:VileToxinsPoisonLimit", "BASE", nil),
		},
	},
#mods

#skill SupportVoidManipulation
	statMap = {
		["support_void_manipulation_chaos_damage_+%_final"] = {
			mod("ChaosDamage", "MORE", nil),
		},
	},
#mods

#skill SupportVoidManipulationPlus
	statMap = {
		["support_void_manipulation_chaos_damage_+%_final"] = {
			mod("ChaosDamage", "MORE", nil),
		},
	},
#mods

#skill SupportParallelProjectiles
	statMap = {
		["support_parallel_projectiles_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Projectile),
		},
	},
#mods

#skill SupportChaosAttacks
#mods

#skill SupportManaforgedArrows
	statMap = {
		["support_manaforged_arrows_damage_+%_final"] = {
			mod("Damage", "MORE", nil, 0, 0),
		},
		["support_manaforged_arrows_damage_+%_final_per_mana_spent"] = {
			mod("Damage", "MORE", nil, 0, 0, { type = "PerStat", stat = "ManaCost" }),
		},
		["support_manaforged_arrows_mana_cost_%_threshold"] = {
			skill("triggeredByManaforged", true, { type = "SkillType", skillType = SkillType.Triggerable }),
			skill("ManaForgedArrowsPercentThreshold", nil),
			div = 100,
		},
	},
#mods

#skill SupportMomentum
	statMap = {
		["support_momentum_max_stacks"] = {
			mod("MomentumStacksMax", "BASE", nil, 0, 0),
		},
		["count_as_momentum_+_if_not_channelled"] = {
			mod("MomentumStacksExtra", "BASE", nil, 0, 0),
		},
		["support_momentum_attack_speed_+%_per_stack"] = {
			mod("Speed", "INC", nil, ModFlag.Attack, 0, { type = "Multiplier", var = "MomentumStacks" }),
		},
		["support_momentum_movement_speed_+%_per_stack_removed"] = {
			mod("MovementSpeed", "INC", nil, 0, 0, { type = "Multiplier", var = "MomentumStacksRemoved" }, { type = "GlobalEffect", effectType = "Buff" }),
		},
	},
#baseMod flag("SupportedByMomentum")
#mods